<ion-view view-title="Browse" cache-view="false">

<ion-content>
</ion-content>

	<ion-tabs class="tabs-striped tabs-top">
		<ion-tab title="Route Add">
			<header class="bar bar-header ">
				<h1 class="page-header">Route</h1>
			</header>
			<ion-content has-header="true">
				<div class="row">
					<form class="navbar-form navbar-left" ng-submit="DoRouteAdd()">
						<label class="btn btn-default"> Add Route</label>
						<div class="form-group">
							<input type="text" placeholder="Route Name" class="form-control" ng-model="RouteData.RouteName">
						</div>
						<div class="form-group">
							<input type="text" placeholder="Route code" class="form-control" ng-model="RouteData.RouteCode">
						</div>
						<div class="form-group">
							<input type="text" placeholder="Route point" class="form-control" ng-model="RouteData.RoutePoint">
						</div>
						<button type="submit" class="btn btn-success">ADD</button>
					</form>
				</div>
				<div class="col panel panel-default">
					<table class="table">
						<thead>
							<tr>
								<th>#ID</th>
								<th>Route Name</th>
								<th>Route Code</th>
								<th>Route Point</th>
								<th>Del</th>
							</tr>
						</thead>
						<tbody>
							<tr ng-repeat="item in RouteList">
								<td>{{$index + 1}}</td>
								<td>{{item.RouteName}}</td>
								<td>{{item.RouteCode}}</td>
								<td>{{item.RoutePoint}}</td>
								<td class="col-md-1">
									<button type="button" class="btn btn-danger btn-sm" ng-click="Del(item._id)">DEL</button>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</ion-content>
		</ion-tab>

		<ion-tab title="Special User">
		  <header class="bar bar-header ">
				<h1 class="page-header">User Route</h1>
		  </header>
		  <ion-content has-header="true">
				<div class="row">
					<form class="navbar-form navbar-left" ng-submit="DoRouteUserAdd()">
						<label class="btn btn-default"> Add user route</label>
						<div class="form-group">
							<input type="text" placeholder="User Name" class="form-control" ng-model="RouteUserData.UserName">
						</div>
						<div class="form-group">
							<input type="text" placeholder="Route code" class="form-control" ng-model="RouteUserData.RouteCode">
						</div>
						
						<button type="submit" class="btn btn-success">ADD</button>
					</form>
				</div>
				<div class="col panel panel-default">
					<table class="table">
						<thead>
							<tr>
								<th>#ID</th>
								<th>Route Name</th>
								<th>Route Code</th>
								<th>Del</th>
							</tr>
						</thead>
						<tbody>
							<tr ng-repeat="item in RouteUserList">
								<td>{{$index + 1}}</td>
								<td>{{item.UserName}}</td>
								<td>{{item.RouteCode}}</td>
								<td class="col-md-1">
									<button type="button" class="btn btn-danger btn-sm" ng-click="RouteUserDel(item._id)">DEL</button>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</ion-content>
		</ion-tab>
	</ion-tabs>
</ion-view>
